<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%String path = request.getContextPath() ;%>
<jsp:include page="import.jsp" flush="true" />
 <body>
 		<div class="ui-widget">
			<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
				<p>
					<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
					<strong>错误提示:</strong> 
					<s:property value="exception.message"/>
				</p>
			</div>
		</div>

	<s:if test="#session.SYSTEMSTATUS">
		<button onclick="toShowError();" id="buttonControl1" >查看错误详情</button>
		<button onclick="toHideError();" id="buttonControl2" style="display:none">隐藏错误详情</button>
	</s:if>
    <br>
   <TEXTAREA id="error" NAME="error"  style="width:100%;height:350px;display:none" readonly>
		<s:property value="exceptionStack"/>
    </TEXTAREA>
	<SCRIPT LANGUAGE="JavaScript">

	var e  = document.getElementById("error");
	var c1 = document.getElementById("buttonControl1");
	var c2 = document.getElementById("buttonControl2");
	
	var toShowError = function(){		
		if(e!=null){
			e.style.display = "";
		}
		if(c1!=null){
			c1.style.display="none";
			c2.style.display="";
		}
	}
	var toHideError = function(){
		if(e!=null){
			e.style.display = "none";
		}
		if(c1!=null){
			c1.style.display="";
			c2.style.display="none";
		}
		}

	var msg = '<s:property value="exception.message"/>';
	if(msg.indexOf('您已被强迫下线')>-1){
		alert("系统将于3秒钟后自动跳转至登录界面。");
		setTimeout('location.href="<%=path%>/systemService/loginOut.action?msg=autoReLogin";',3000);
	}
	
	</SCRIPT>
  </body>
  